# Python自带库函数iter()和next()的学习
it = iter([1, 3, 6, 2, 7])
print(next(it))
print(next(it))
print(next(it))
print(next(it))
print(next(it))


# 自定义迭代器
def float_range(start, stop, step):
    while start < stop:
        yield start
        start += step


for i in float_range(1, 5, 0.5):
    print(i)
